<!--
 * @Author: your name
 * @Date: 2021-09-15 20:08:18
 * @LastEditTime: 2021-09-28 11:38:38
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \vue-element-admin-4.4.0\src\views\A-project\toReport\toReport.vue
-->
<template>
  <div>
    <el-table
      :data="
        stuinfo.slice((currentPage - 1) * pagesize, currentPage * pagesize)
      "
      style="width: 100%"
    >
      <el-table-column
        label="退货id"
        prop="returnGoodsId"
      ></el-table-column>
      <el-table-column
        label="订单id"
        prop="orderId"
      ></el-table-column>
      <el-table-column
        label="商品id"
        prop="orderDetailId"
      ></el-table-column>
      <el-table-column
        label="退货原因"
        prop="returnGoodsReason"
      ></el-table-column>
      <el-table-column
        label="退货金额"
        prop="returnGoodsPayment"
      ></el-table-column>
      <el-table-column
        label="退货发起时间"
        prop="createTime"
      ></el-table-column>
      <el-table-column
        label="快递公司名称"
        prop="shippingCompName2"
      ></el-table-column>
      <el-table-column
        label="快递单号"
        prop="shippingSerialNumber"
      ></el-table-column>
      <el-table-column label="操作">
        <template v-slot="scope">
          <el-button
            @click="zeroUpdateReturnGood1(scope.row)"
            type="danger"
          >
            通过
          </el-button>
        </template>
      </el-table-column>
    </el-table>
    <div class="block">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-sizes="[2, 3, 4, 5]"
        :page-size="pagesize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="stuinfo.length"
      >
      </el-pagination>
    </div>
   
  </div>
</template>

<script>
  import Api from '@/api/audit/return'

export default {
  data() {
    return {
      // isDi:"",
      //内容条数
      pagesize: 3,
      //当前页
      currentPage: 1,
      stuinfo: [],
      returnGood:{
        orderDetailId:undefined
      }
    };
  },
  methods: {
    zeroFindReturnGood3() {
      Api
        .zeroFindReturnGood3()
        .then(
          (res) => (
            console.log(res),
            (this.stuinfo = res.data.zeroFindReturnGood3),
            console.log(this.stuinfo)
          )
        );
    },
    handleSizeChange(size) {
      console.log("size" + size);
      this.pagesize = size;
    },
    handleCurrentChange(currentPage) {
      console.log("currentPage" + currentPage);
      this.currentPage = currentPage;
    },
    zeroUpdateReturnGood1(row) {
      this.returnGood.returnGoodsId=row.returnGoodsId
      this.returnGood.orderDetailId=row.orderDetailId
      this.returnGood.returnGoodsPayment=row.returnGoodsPayment
      Api
        .zeroUpdateReturnGood1(this.returnGood)
        .then(
          (res) => (
            console.log(res),
           this.zeroFindReturnGood3()
          )
        );
    },
  },
  mounted() {
    this.zeroFindReturnGood3();
  },
};
</script>
<style>
</style>